<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style type="text/css">
	label.col-2{width: 120px;}
	
	
	#autocomplate{
		position: absolute; top: 40px; width: 100%; border-radius: 5px; 
		display: none; background-color: #ddd; z-index: 1000; 
	}
	#autocomplate li{list-style: none; border-bottom: #fff 1px dashed; line-height: 35px; padding:0px 5px; cursor: pointer;}
	#autocomplate li:active{background-color: #fff; color: #333;}
	#autocomplate li:hover{background-color: #fff; color: #333;}
	
</style>
<title>消息推送</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form1">
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>标题：</label>
			<div class="formControls col-6">
				<input type="text" class="input-text" value="" placeholder="" id="dw_title" name="dw_title" nullmsg="作品名称不能为空！" datatype="s1-100">
			</div>
			<div class="col-3"> </div>
			<!-- <div class="btn btn-secondary-outline radius col-2">检测重复</div> -->
		</div>
		

		
		<div class="row cl">
			<label class="form-label col-2">选择推送会员：</label>
			<div class="formControls col-2" style="position: relative;">
				<input type="text" class="input-text" value="" placeholder="" id="searchshopinput" onfocus="opensearch()" onblur="setTimeout(closesearch,200)" autocomplete="off" nullmsg="推送会员不能为空！">
				<input type="hidden" name="transport_id">
				<div id="autocomplate" class="thinklist">
					
				</div>
			</div>
			<div class="col-1"></div>
		</div>
		<div class="row cl" >
			<label class="form-label col-2"></label>
			<div class="formControls col-3" ></div>
		</div>
		<script type="text/javascript">
			var prevKeywordVal;
			var intervalId;

			
			// 商家列表联想搜索
			function autocomplate(){
			    var input=$("#searchshopinput");
			    if(window.prevKeywordVal === $(input).val() || $(input).val()==''){
			        return false;
			    }
			    var html='';
			    var api=API_USER+'?k='+$(input).val();
			    var autocomplate='#autocomplate';
			    $.getJSON(api,function(data){
			        if(!checkStatus(data)) return;
			        $(autocomplate).show().html('');
			        for (x in data.datas){
			            html+="<li data-name="+data.datas[x].user_name+" data-id="+data.datas[x].uid+">"+data.datas[x].uid+": "+data.datas[x].user_name+"</li>";
			        }
			        $(autocomplate).html(html);
			    }); 
			    if($(input).val()!==''){
			    	prevKeywordVal=$(input).val(); 
			    }
			    // window.prevKeywordVal=$(input).val(); 
			}
			
			// 打开搜索列表
			function opensearch() {
				$('#autocomplate').show();
				var html='';
				$.getJSON(API_USER,function(data){
					for (x in data.datas){
					    html+="<li data-name="+data.datas[x].user_name+" data-id="+data.datas[x].uid+">"+data.datas[x].uid+": "+data.datas[x].user_name+"</li>";
					}
					$('#autocomplate').html(html);
				})
				intervalId=setInterval('autocomplate()',500);
			}
			// 关闭搜索框
			function closesearch(){
				$('#autocomplate').hide();
				clearInterval(intervalId);

			}
		</script>



		
		
		<div class="row cl">
			<label class="form-label col-2">消息内容：</label>
			<div class="formControls col-10"> 
				<textarea name="article_brief" id="article_brief" cols="" rows="" class="textarea"  placeholder="文章摘要..." ></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>
		

		
</div>

<div class="row cl pr-20" style="position:fixed; bottom:10px; width: 200px; right: 10px; text-align: right; z-index:1000; ">
	
		<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
		<button onClick="removeIframe();" class="btn btn-default radius" type="button" style="margin-left:10px;">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
	
</div>
</form>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script src="/Public/js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 

<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 


<script type="text/javascript">
var companyinfo;//栏目信息-编辑


function removeIframe(){
	var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}



 
$(function(){

	
	$("#form1").attr("action", API_MESSAGE); 

	var editid=getUrlParam('editid');//编辑菜单id
	if(editid!==null){	     
	    var eidturl=API_MESSAGE+"?id="+editid;
	    // 读取即将编辑的设计信息
	    $.getJSON(eidturl,function(data){

	    	if(!checkStatus(data)) return;//判断登录

	    	if(data.datas==''){
	    		layer.msg("数据加载错误", {icon:2,time:1000});
	    	}else{
	       
	            $("#dw_title").val(data.datas.dw_title);
	            
	            $("#form1").attr("action", eidturl);
	            
	            
	            
	       
	            if(data.datas.is_recommend=='0'){
	                $("#radio-2").attr("checked",true);
	                $("#radio-1").attr("checked",false);
	            }else{
	                $("#radio-1").attr("checked",true);
	                $("#radio-2").attr("checked",false);
	            }


                
	            companyinfo=  data.datas.uid; //给栏目信息变量赋值

	            

	            
	            
	           
	 
	        }
	    })
	}



	
	Validformsubmit("#form1");

	
	
	
	
	



});


// 移除选中的图片
function fj_close(obj){
	$(obj).parents("li").remove();
}


</script>
</body>
</html>